package com.damai.pay;

import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.damai.action.BaseServiceAction;

public class PayServerNotifyAction extends BaseServiceAction {

	public PayServerNotifyAction(String key) {
		super(key);
	}

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) throws IOException {
		String strType = (String) request.getAttribute("0");
		PayAdapter<?> adapter = PayAdapterManager.getAdapter(strType);
		if(adapter==null){
			response.getWriter().print("OK");
			return;
		}
		adapter.onServerNotify(request, response);
	}

}
